/* 机构管理 */
import instance from "@/utils/index";
import { formval, peopleObj } from '@/types/typeData'
import { IDataType, editType, treeList, treeItem, IData, itemCity, IPeople } from '@/types/data'
// 机构管理树形
export const treeApi = () =>
  instance.request<IDataType<treeList>>({
    url: "/business-hall/tree"
  })
// 获取机构管理详细
export const treeItemApi = (id: string) =>
  instance.request<IDataType<treeItem>>({
    url: `/business-hall/${id}`,
  })
// 获取城市city1
export const city1 = () =>
  instance.request<IData<itemCity>>({
    url: '/areas/children'
  })
// 获取城市city2 city3
export const city2 = (id: string) =>
  instance.request<IData<itemCity>>({
    url: `/areas/children`,
    params: {
      parentId: id
    }
  })
// 编辑机构信息
export const editApi = (data: formval) =>
  instance.request({
    url: '/business-hall',
    data,
    method: 'post'
  })
// 获取机构成员信息
export const peopleApi = (params: peopleObj) =>
  instance.request<IData<IPeople>>({
    url: '/business-hall/user/page',
    params
  })